<?php
  
  class Yahoo {
		
   function Get_status($yahooid){
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, 'http://opi.yahoo.com/online?u=$yahooid&m=a&t=1');
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		$status = curl_exec($ch);

     // $status = file_get_contents("http://opi.yahoo.com/online?u=$yahooid&m=a&t=1");

    if ($status === '00') {

      return false;

    } elseif ($status === '01') {

       return true;

   }

  }
  
  function getSkypeStatus($username) {
 	 $ch = curl_init();
	 curl_setopt($ch, CURLOPT_URL, 'http://mystatus.skype.com/' . urlencode($username) . '.xml');
	 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	 $data = curl_exec($ch);
	 //$data = file_get_contents('http://mystatus.skype.com/' . urlencode($username) . '.xml');
		preg_match('@<presence xml:lang="en">(.*?)</presence>@i', $data, $match);
	
		return isset($match[1]) ? $match[1] : 'Error retrieving status';
	
    /*$data = file_get_contents('http://mystatus.skype.com/' . urlencode($username) . '.xml');
    preg_match('@<presence xml:lang="en">(.*?)</presence>@i', $data, $match);

    return isset($match[1]) ? $match[1] : 'Error retrieving status';
	*/
}

}
?>